
package com.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ProductDao;
import com.entity.ProductEntity;
import com.service.ProductService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;


/**
 * 生成镁砖
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> implements ProductService {


    @Override
    public Page<ProductEntity> allProduct(Integer pageNum, Integer pageSize, String value) {
        EntityWrapper<ProductEntity> wrapper = new EntityWrapper<>();
        if(StringUtils.isNotBlank(value)){
            wrapper.like("name",value);
        }
        return this.selectPage(new Page<>(pageNum,pageSize),wrapper);
    }
}
